package org.hxyjs.controller;

import org.hxyjs.dto.DTO;
import org.hxyjs.entity.Chart;
import org.hxyjs.service.ChartService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RestController
@CrossOrigin
@RequestMapping("/chartController")
public class ChartController {
    @Resource
    ChartService chartService;

    @RequestMapping("/charts/{chartName}")
    public DTO<Chart> getCharts(@PathVariable("chartName") String chartName){
       return chartService.getCharts(chartName);
    }
}
